/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dispositivos;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;

/**
 *
 * @author 66880717
 */
public class DispositivoURL implements Dispositivo{

      @Override
    public String leer(String... ruta) {
        String resultado = "";
        try {
            URL url = new URL (ruta[0]);
            //URLConnection con = url.openConnection();
            
            BufferedReader br = new BufferedReader( new InputStreamReader (url.openStream()));
            String line;
            
            while ((line = br.readLine())!=null) resultado += line + "\n";
                
            } catch (IOException ex) {                
               ex.printStackTrace(System.err);
            }
        return resultado;
            
        
        }
    
}
